.class public Lcom/waiqin365/h5/department/WqDepartmentSelectMore;
.super Lorg/apache/cordova/CordovaPlugin;

# interfaces
.implements Ljava/util/Observer;


# instance fields
.field public final a:Ljava/lang/String;

.field private b:Lorg/apache/cordova/WqCordovaActivity;

.field private c:Lorg/apache/cordova/CallbackContext;

.field private d:Lorg/apache/cordova/CordovaArgs;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->a:Ljava/lang/String;

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/department/WqDepartmentSelectMore;)Lorg/apache/cordova/CordovaArgs;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->d:Lorg/apache/cordova/CordovaArgs;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/h5/department/WqDepartmentSelectMore;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->b:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 2

    iget-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->c:Lorg/apache/cordova/CallbackContext;

    iput-object p2, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->d:Lorg/apache/cordova/CordovaArgs;

    iget-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->getThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    new-instance v1, Lcom/waiqin365/h5/department/b;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/department/b;-><init>(Lcom/waiqin365/h5/department/WqDepartmentSelectMore;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    const/4 v0, 0x1

    return v0
.end method

.method public update(Ljava/util/Observable;Ljava/lang/Object;)V
    .locals 7

    if-eqz p2, :cond_3

    instance-of v0, p2, Lcom/waiqin365/lightapp/view/a/a;

    if-eqz v0, :cond_3

    iget-object v1, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->a:Ljava/lang/String;

    move-object v0, p2

    check-cast v0, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, v0, Lcom/waiqin365/lightapp/view/a/a;->a:Ljava/lang/String;

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    check-cast p2, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v0, p2, Lcom/waiqin365/lightapp/view/a/a;->b:Ljava/lang/Object;

    check-cast v0, Ljava/util/HashMap;

    if-eqz v0, :cond_3

    const-string/jumbo v1, "selectDepList"

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    const-string/jumbo v1, "selectDepList"

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/List;

    if-eqz v0, :cond_3

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-lez v1, :cond_3

    new-instance v4, Lorg/json/JSONArray;

    invoke-direct {v4}, Lorg/json/JSONArray;-><init>()V

    const/4 v1, 0x0

    move v2, v1

    :goto_0
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    if-ge v2, v1, :cond_2

    new-instance v5, Lorg/json/JSONObject;

    invoke-direct {v5}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/waiqin365/lightapp/kehu/share/a/m;

    const-string/jumbo v6, "id"

    iget-object v3, v1, Lcom/waiqin365/lightapp/kehu/share/a/m;->b:Ljava/lang/String;

    invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-eqz v3, :cond_0

    const-string/jumbo v3, ""

    :goto_1
    invoke-virtual {v5, v6, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v3, "name"

    iget-object v6, v1, Lcom/waiqin365/lightapp/kehu/share/a/m;->c:Ljava/lang/String;

    invoke-static {v6}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_1

    const-string/jumbo v1, ""

    :goto_2
    invoke-virtual {v5, v3, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    invoke-virtual {v4, v5}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;

    :goto_3
    add-int/lit8 v1, v2, 0x1

    move v2, v1

    goto :goto_0

    :cond_0
    iget-object v3, v1, Lcom/waiqin365/lightapp/kehu/share/a/m;->b:Ljava/lang/String;

    goto :goto_1

    :cond_1
    iget-object v1, v1, Lcom/waiqin365/lightapp/kehu/share/a/m;->c:Ljava/lang/String;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    :cond_2
    iget-object v0, p0, Lcom/waiqin365/h5/department/WqDepartmentSelectMore;->c:Lorg/apache/cordova/CallbackContext;

    invoke-virtual {v0, v4}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONArray;)V

    :cond_3
    return-void

    :catch_0
    move-exception v1

    goto :goto_3
.end method
